//
//  CashAllDataModel.m
//  CashBook
//
//  Created by 吴斌 on 2024/9/4.
//

#import "CashAllDataModel.h"
@implementation CashAllYearDataModel
+ (NSDictionary *)mj_objectClassInArray{
    return @{@"allYearRecord":[CashAllMonthDataModel class]};
}
//归档调用
- (void)encodeWithCoder:(NSCoder *)encoder{
    [encoder encodeObject:self.yearTime forKey:@"yearTime"];
    [encoder encodeObject:self.allYearPay forKey:@"allYearPay"];
    [encoder encodeObject:self.allYearIncome forKey:@"allYearIncome"];
    [encoder encodeObject:self.allYearRecord forKey:@"allYearRecord"];
}
//解档调用
-(instancetype)initWithCoder:(NSCoder *)coder{
    if (self = [super init]) {
        self.yearTime = [coder decodeObjectForKey:@"yearTime"];
        self.allYearPay = [coder decodeObjectForKey:@"allYearPay"];
        self.allYearIncome = [coder decodeObjectForKey:@"allYearIncome"];
        self.allYearRecord = [coder decodeObjectForKey:@"allYearRecord"];
    }
    return self;
}
+ (BOOL)supportsSecureCoding {
    return YES;
}
@end

@implementation CashAllMonthDataModel
+ (NSDictionary *)mj_objectClassInArray{
    return @{@"allMonthRecord":[CashAllDayDataModel class]};
}
//归档调用
- (void)encodeWithCoder:(NSCoder *)encoder{
    [encoder encodeObject:self.monthTime forKey:@"monthTime"];
    [encoder encodeObject:self.allMonthPay forKey:@"allMonthPay"];
    [encoder encodeObject:self.allMonthIncome forKey:@"allMonthIncome"];
    [encoder encodeObject:self.allMonthRecord forKey:@"allMonthRecord"];
}
//解档调用
-(instancetype)initWithCoder:(NSCoder *)coder{
    if (self = [super init]) {
        self.monthTime = [coder decodeObjectForKey:@"monthTime"];
        self.allMonthPay = [coder decodeObjectForKey:@"allMonthPay"];
        self.allMonthIncome = [coder decodeObjectForKey:@"allMonthIncome"];
        self.allMonthRecord = [coder decodeObjectForKey:@"allMonthRecord"];
    }
    return self;
}
+ (BOOL)supportsSecureCoding {
    return YES;
}
@end

@implementation CashAllDayDataModel
//归档调用
- (void)encodeWithCoder:(NSCoder *)encoder{
    [encoder encodeObject:self.dyaTime forKey:@"dyaTime"];
    [encoder encodeObject:self.allDayPay forKey:@"allDayPay"];
    [encoder encodeObject:self.allDayIncome forKey:@"allDayIncome"];
    [encoder encodeObject:self.allDayRecord forKey:@"allDayRecord"];
}
//解档调用
-(instancetype)initWithCoder:(NSCoder *)coder{
    if (self = [super init]) {
        self.dyaTime = [coder decodeObjectForKey:@"dyaTime"];
        self.allDayPay = [coder decodeObjectForKey:@"allDayPay"];
        self.allDayIncome = [coder decodeObjectForKey:@"allDayIncome"];
        self.allDayRecord = [coder decodeObjectForKey:@"allDayRecord"];
    }
    return self;
}
+ (BOOL)supportsSecureCoding {
    return YES;
}
@end

@implementation CashAllDataModel
+ (NSDictionary *)mj_objectClassInArray{
    return @{@"allRecordArray":[CashAllYearDataModel class]};
}
//归档调用
- (void)encodeWithCoder:(NSCoder *)encoder{
    [encoder encodeObject:self.allIcon forKey:@"allIcon"];
    [encoder encodeObject:self.allBudget forKey:@"allBudget"];
    [encoder encodeObject:self.allPay forKey:@"allPay"];
    [encoder encodeObject:self.allIncome forKey:@"allIncome"];
    [encoder encodeObject:self.allRecordArray forKey:@"allRecordArray"];
}
//解档调用
-(instancetype)initWithCoder:(NSCoder *)coder{
    if (self = [super init]) {
        self.allIcon = [coder decodeObjectForKey:@"allIcon"];
        self.allBudget = [coder decodeObjectForKey:@"allBudget"];
        self.allPay = [coder decodeObjectForKey:@"allPay"];
        self.allIncome = [coder decodeObjectForKey:@"allIncome"];
        self.allRecordArray = [coder decodeObjectForKey:@"allRecordArray"];
    }
    return self;
}
+ (BOOL)supportsSecureCoding {
    return YES;
}
@end
